﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Golden_Miner
{
    /// <summary>
    /// 矿石类
    /// </summary>
    class Ore
    {
        public Rectangle Rectangle { get; set; }

        /// <summary>
        /// 矿石位置
        /// </summary>
        public Point[] _goldPoints1 =
        {
            new Point (100,230),
            new Point (700,380),
            new Point (550,210),
            new Point (120,554),
            new Point (232,157),
            new Point (400,552),
        };
        public Point[] _stonePoints1 =
        {
            new Point (270,624),
            new Point (660,564),
            new Point (465,375),
            new Point (130,400),
            new Point (570,600),
            new Point (800,610),
        };
        public Point[] _walletPoints1 =
        {
            new Point (320,444),
            new Point (739,170),
        };

        public Point[] _goldPoints2 =
       {
            new Point (150,230),
            new Point (770,380),
            new Point (550,310),
            new Point (320,554),
            new Point (430,457),
            new Point (250,552),
        };
        public Point[] _stonePoints2 =
        {
            new Point (370,124),
            new Point (660,564),
            new Point (665,175),
            new Point (132,400),
            new Point (200,150),
            new Point (400,510),
        };
        public Point[] _walletPoints2 =
        {
            new Point (120,544),
            new Point (739,270),
        };
        /// <summary>
        ///过程中使用到的随机数
        /// </summary>
        private static  Random rd = new Random();

        public Ore(Rectangle rec)
        {
            Rectangle = rec;

            //初始化矿石位置
            

        }
        /// <summary>
        /// 绘图
        /// </summary>
        /// <param name="g"></param>
        public void stoneDraw(Graphics g)
        {
              g.DrawImage(Properties.Resources.石头, Rectangle);                            
        }
        public void goldDraw(Graphics g)
        {
            g.DrawImage(Properties.Resources.金子, Rectangle);                                      
        }
        public void walletDraw(Graphics g)
        {                   
            g.DrawImage(Properties.Resources.钱包, Rectangle);                   
        }

        /// <summary>
        /// 生成矿石大小
        /// </summary>
        /// <param name="random">传入的随机数</param>
        /// <returns></returns>
        public Size OreSize(int random)
        {
            Size size = new Size(30 * random, 30 * random);
            return size;
        }

        /// <summary>
        /// 判断大小
        /// </summary>
        /// <returns></returns>
        public int oreSize(int height)
        {
            if (height == 30)
            {
                return 1;
            }
            else if (height == 60)
            {
                return 2;
            }
            else
            {
                return 3;
            }
        }
    }
 
}
